<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="../../../css/common.css" media="all">
	</head>
	<body>

		<div class="layui-fluid">
			<div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-card"><table id="table-main" lay-filter="table-main-operate"></table></div>
                </div>
			</div>
		</div> 
		<script src="../../../layuiadmin/layui/layui.js?t=1"></script>
		<script src="../../../js/common.js"></script>
		<script>
			layui.config({
				base: '../../../layuiadmin/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index', 'table'], function() {
				var table = layui.table,
					$ = layui.$,
					admin = layui.admin;
                var _data = {
                    shopid: getParam('shopid'),
                    accountday: getParam('accountday'),
                }
                initdata();

                function initdata() {
                    //今日待发货订单
                    table.render({
                        elem: '#table-main',
                        page: true,
                        where: _data,
                        limit: limit,
                        limits: limits,
                        height: 'full-60',
                        url: server.sys_account_record_list,
                        cols: [
                            [
                                { field: 'accountday', width: 120, title: '结转/释放日' },
                                { 
                                    field: 'type', width: 100, title: '类型',
                                    templet: function(d) {
                                        switch(d.type) {
                                            case 0:
                                                return '结转' 
                                            case 1:
                                                return '调仓'
                                            case 2:
                                                return '释放'
                                        }
                                    }
                                },
                                { field: 'ledger_in', width: 100, title: '入账账仓' },
                                { field: 'ledger_out', width: 100, title: '出账账仓' },
                                { field: 'ledger_fee', width: 100, title: '涉帐金额' },
                                { field: 'amount', width: 100, title: '账户金额' },
                                { field: 'cash_release', width: 120, title: '日释放金额' },
                                { field: 'cash_total', width: 100, title: '汇总金额' },
                                { field: 'memo', width: 200, title: '备注' },
                                { field: 'addtime', width: 160, title: '创建时间' },
                            ]
                        ],
                        parseData: function(res) { //将原始数据解析成 table 组件所规定的数据
                            return {
                                "code": res.code, //解析接口状态
                                "msg": res.msg, //解析提示文本
                                "count": res.shop_account_record.pager.total, //解析数据长度
                                "data": res.shop_account_record.data //解析数据列表
                            };
                        }
                    });
                }
				
			});
		</script>
	</body>
</html>
